from tkinter import *
from my_frame.homegnclass import HomeFrame
from my_frame.updown import DataFra
from my_frame.admin import Data2Fra
from my_frame.ximing import DataFra3
from my_frame.minifuc import MiniFra
from my_frame.homegnclass import *
from my_frame.ximing2 import DataFra7
from updateExe import up000
from mini_tools.mytools import *
import tkinter as tk
import requests

session=requests.session()

up000()
root = tk.Tk()
root.title('虾皮产品索引')
root.geometry("800x700")
w=root.winfo_screenwidth()
h=root.winfo_screenheight()
cjurlsq=0



rbtnFra=Frame(root,width=800)
rbtnFra.pack(pady=5)
v = IntVar()
v.set(1)
pidfra=HomeFrame(root)
datafra=DataFra(root)
data2fra=Data2Fra(root)
data3fra=DataFra3(root)
minifra=MiniFra(root)
data7fra=DataFra7(root)
lfras=[pidfra,datafra,data2fra,data3fra,minifra,data7fra]
sq=0

def changesr():
    global sq
    if not sq:
        return
    j=1
    for fra in lfras:
        if j==v.get():
            fra.pack(fill=X)
        else:
            fra.pack_forget()
        j+=1

changesr()
Radiobutton(rbtnFra, text="采集", variable=v, value=1,command=changesr).grid(row=0,column=1,padx=3)
Radiobutton(rbtnFra, text="数据管理", variable=v, value=2,command=changesr).grid(row=0,column=2,padx=3)
#Radiobutton(rbtnFra, text="管理员功能", variable=v, value=3,command=changesr).grid(row=0,column=4,padx=3)
Radiobutton(rbtnFra, text="沂敏", variable=v, value=4,command=changesr).grid(row=0,column=5,padx=3)
Radiobutton(rbtnFra, text="沂敏2", variable=v, value=6,command=changesr).grid(row=0,column=6,padx=3)
Radiobutton(rbtnFra, text="小工具", variable=v, value=5,command=changesr).grid(row=0,column=3,padx=3)

if __name__=='__main__':
    [fra.pack_forget() for fra in lfras]
    sq=1
    changesr()
    root.mainloop()
